package com.zjitc.controller;

import com.zjitc.common.ServerResponse;
import com.zjitc.pojo.Category;
import com.zjitc.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.io.IOException;

/**
 * Create By IntelliJ IDEA
 *
 * @author: myq
 * @create-Time: 2017/11/14  11:42
 */
@Controller
@RequestMapping("/category")
public class CategoryController {

  @Autowired
  private CategoryService service;

  @RequestMapping("/getcategory")
  @ResponseBody
  public ServerResponse<Category> getcategory() throws IOException {
    return service.findAll();
  }
}
